package com.example.train.common.resp;

public class CommonResp<T> {

    //返回业务成功或者失败
    private boolean success=true;
    //返回信息
    private String message;
    //返回泛型数据
    private T content;

    public CommonResp(){}
    public CommonResp(boolean success,String message,T content){
        this.success=success;
        this.message=message;
        this.content=content;
    }
    public CommonResp(T content){
        this.content=content;
    }

    public boolean getSuccess() {
        return success;
    }
    public void setSuccess(boolean success) {
        this.success = success;
    }
    public String getMessage() {
        return message;
    }
    public void setMessage(String message) {
        this.message = message;
    }
    public T getContent() {
        return content;
    }
    public void setContent(T content) {
        this.content = content;
    }

    @Override
    public String toString(){
        final StringBuilder sb = new StringBuilder("CommonResp{");
        sb.append("success=").append(success);
        sb.append(", message=").append(message);
        sb.append(", content=").append(content);
        sb.append('}');
        return sb.toString();
    }
}
